package com.link2room.soundwave.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * @author sqj88
 * @date 2018/1/8 15:20
 */
@Entity
@Table(name = "pms_point_detail")
@DynamicInsert
public class PmsPointDetail extends BaseEntity{
    private String l2RMemberNo;
    private String operaType;
    private String srcType;
    private BigDecimal pointValue;
    private String isSuccess;

    @Basic
    @Column(name = "l2r_member_no", nullable = true, length = 32)
    public String getL2RMemberNo() {
        return l2RMemberNo;
    }

    public void setL2RMemberNo(String l2RMemberNo) {
        this.l2RMemberNo = l2RMemberNo;
    }

    @Basic
    @Column(name = "opera_type", nullable = false, length = 32)
    public String getOperaType() {
        return operaType;
    }

    public void setOperaType(String operaType) {
        this.operaType = operaType;
    }

    @Basic
    @Column(name = "src_type", nullable = true, length = 32)
    public String getSrcType() {
        return srcType;
    }

    public void setSrcType(String srcType) {
        this.srcType = srcType;
    }

    @Basic
    @Column(name = "point_value", nullable = false, precision = 2)
    public BigDecimal getPointValue() {
        return pointValue;
    }

    public void setPointValue(BigDecimal pointValue) {
        this.pointValue = pointValue;
    }

    @Basic
    @Column(name = "is_success", nullable = true, length = 2)
    public String getIsSuccess() {
        return isSuccess;
    }

    public void setIsSuccess(String isSuccess) {
        this.isSuccess = isSuccess;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        PmsPointDetail that = (PmsPointDetail) o;

        if (l2RMemberNo != null ? !l2RMemberNo.equals(that.l2RMemberNo) : that.l2RMemberNo != null) return false;
        if (operaType != null ? !operaType.equals(that.operaType) : that.operaType != null) return false;
        if (pointValue != null ? !pointValue.equals(that.pointValue) : that.pointValue != null) return false;
        if (isSuccess != null ? !isSuccess.equals(that.isSuccess) : that.isSuccess != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = l2RMemberNo != null ? l2RMemberNo.hashCode() : 0;
        result = 31 * result + (operaType != null ? operaType.hashCode() : 0);
        result = 31 * result + (pointValue != null ? pointValue.hashCode() : 0);
        result = 31 * result + (isSuccess != null ? isSuccess.hashCode() : 0);
        return result;
    }
}
